//////////////////////////////////////////////////////////////////
//Nama File 			: mArea.cpp								//
//Deskripsi				: Driver untuk kelas Field,				//
//						  LField, NLField, dan AllMap			//
//Penanggung Jawab File	: 										//
//				Nama	: Yosef Ardhito Winatmoko				//
//				NIM		: 13509052								//
//////////////////////////////////////////////////////////////////

#include "Area.h"

int main() {
	AllMap TES;																			//membuat sebuah objek AllMap
	LField Tes[8][8];																	//menyiapkan beberapa objek LField untuk percobaan
	int i,j;																			//variabel bantu
	int f[8][10];																		//menyiapkan array of array of integer untuk store kondisi
	//Driver untuk kelas Field
	cout << "----------------------------------------------" << endl;
	cout << "GET ID TES[3][3] : " << (Tes[3][3].GetPlant())->getID() << endl;
	cout << "KONDISI PLANTEXIST SEKARANG?" << ((TES.GetLFieldXY(2,2))->IsPlantExist()) << endl;
	cout << "SET PLANTABLE LFIELD 2,2 MENJADI 1" << endl;
	(TES.GetLFieldXY(2,2))->SetPlantExist(1);
	cout << "KONDISI PLANTEXIST SEKARANG?" << ((TES.GetLFieldXY(2,2))->IsPlantExist()) << endl;
	cout << "ISCANGKUL?" << ((TES.GetLFieldXY(2,2))->IsCangkul()) << endl;
	cout << "GETCOND?" << (TES.GetXYCond(2,2)) << endl;
	cout << "KONDISI PLANTEXIST SEKARANG?" << ((TES.GetLFieldXY(2,2))->IsPlantExist()) << endl;
	cout << "SET PLANTABLE LFIELD 2,2 MENJADI 0" << endl;
	(TES.GetLFieldXY(2,2))->SetPlantExist(0);
	cout << "KONDISI PLANTEXIST SEKARANG DI SET JADI 0: " << ((TES.GetLFieldXY(2,2))->IsPlantExist()) << endl;
	((TES.GetLFieldXY(2,2))->Kerja('c'));
	cout << "KONDISI CANGKUL SEKARANG?" << ((TES.GetLFieldXY(2,2))->IsCangkul()) << endl;
	((TES.GetLFieldXY(2,2))->Kerja('1'));
	cout << "----------------------------------------------" << endl;
	cout << "BARUSAN ANE CANGKUL TRUS TANEM GANJA!" << endl;
	cout << "GETCOND AFTER?" << (TES.GetXYCond(2,2)) << endl;
	cout << "GETCANGKUL AFTER?" << ((TES.GetLFieldXY(2,2))->IsCangkul()) << endl;
	cout << "INFO TANAMAN?" << endl;
	cout << "ID         : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getID() << endl;
	cout << "UMUR       : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getUmur() << endl;
	cout << "HAPPYMETER : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getHappyMeter() << endl;
	cout << "----------------------------------------------" << endl;
	cout << "MISALNYA HARI BERIKUTNYA TANPA DISIRAM..." << endl;
	(TES.GetLFieldXY(2,2))->Sync();
	cout << "SINKRONISASI GAN...." << endl;
	cout << "INFO TANAMAN?" << endl;
	cout << "ID         : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getID() << endl;
	cout << "UMUR       : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getUmur() << endl;
	cout << "HAPPYMETER : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getHappyMeter() << endl;
	cout << "----------------------------------------------" << endl;
	cout << "SEKARANG COBA DISIRAM!" << endl;
	(TES.GetLFieldXY(2,2))->SetSiram(1);
	cout << "NE BUKTINYA : " << ((TES.GetLFieldXY(2,2))->IsPlantable()) << endl;
	cout << "SEKARANG KONDISI DIA : " << ((TES.GetLFieldXY(2,2))->GetCond()) << endl;
	(TES.GetLFieldXY(2,2))->Sync();
	cout << "SINKRONISASI GAN.." << endl;
	cout << "INFO TANAMAN?" << endl;
	cout << "ID         : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getID() << endl;
	cout << "UMUR       : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getUmur() << endl;
	cout << "HAPPYMETER : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getHappyMeter() << endl;
	cout << "----------------------------------------------" << endl;
	cout << "BERHUBUNG INI HARI BERIKUTNYA..." << endl << "HARUSNYA SIRAMNYA 0 LAGI! : " << ((TES.GetLFieldXY(2,2))->IsSiram()) << endl;
	cout << "SKARANG SIRAM LAGI!" << endl;
	((TES.GetLFieldXY(2,2))->SetSiram(1));
	cout << "SIRAM : " << ((TES.GetLFieldXY(2,2))->IsPlantable()) << endl;
	cout << "SEKARANG KONDISI DIA : " << ((TES.GetLFieldXY(2,2))->GetCond()) << endl;
	cout << "----------------------------------------------" << endl;
	cout << "COBA SINKRONISASI DI ALLMAP!" << endl;
	TES.SyncAll();
	cout << "INFO TANAMAN?" << endl;
	cout << "ID         : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getID() << endl;
	cout << "UMUR       : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getUmur() << endl;
	cout << "HAPPYMETER : " << ((TES.GetLFieldXY(2,2))->GetPlant())->getHappyMeter() << endl;
	cout << "WOWOWOW~~" << endl;
	cout << "----------------------------------------------" << endl;
	cout << "ISENG AH COBA KONVPRINT!" << endl;
	TES.KonvPrint(0,f);
	cout << f[2][2] << endl;
	cout << "BELUM DISIRAM PALING DEKET = " << (TES.GetFieldwProp(0)) << endl;
	cout << "YOI DRIVER BERES..." << endl;
	cout << "----------------------------------------------" << endl;
	return 0;
	}